package cn.JHai.rbac.domain;


import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Customer implements Serializable {
    private Long id;

    private String name;

    private Long age;

    private Long gender;

    private String tel;

    private String qq;

    private Long job_id;

    private Long source_id;

    private Long seller_id;

    private Long input_user_id;

    private Date input_time;

    private Long status;

    private String job;

    private String source;

    private String seller;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getAge() {
        return age;
    }

    public void setAge(Long age) {
        this.age = age;
    }

    public Long getGender() {
        return gender;
    }

    public void setGender(Long gender) {
        this.gender = gender;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public Long getJob_id() {
        return job_id;
    }

    public void setJob_id(Long job_id) {
        this.job_id = job_id;
    }

    public Long getSource_id() {
        return source_id;
    }

    public void setSource_id(Long source_id) {
        this.source_id = source_id;
    }

    public Long getSeller_id() {
        return seller_id;
    }

    public void setSeller_id(Long seller_id) {
        this.seller_id = seller_id;
    }

    public Long getInput_user_id() {
        return input_user_id;
    }

    public void setInput_user_id(Long input_user_id) {
        this.input_user_id = input_user_id;
    }

    public void setInput_time(Date input_time) {
        this.input_time = input_time;
    }

    public Long getStatus() {
        return status;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSeller() {
        return seller;
    }

    public void setSeller(String seller) {
        this.seller = seller;
    }

    public String getInput_time() {
        SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
        if (input_time==null){
            return null;
        }
        String time = dateformat.format(input_time);
        return time;
    }

    public JSONObject getJson() {

        //*{"id":id,"name":name,"age":age,"gender":gender,"tel":tel,"qq":qq,"job_id":job_id,"source_id":source_id,"seller_id":seller_id,"input_user_id":input_user_id,"input_time":"2018/07/01 15:41:42","status":0,"job":"学生","source":"营销广告","seller":"钱二明"

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id",id);
        jsonObject.put("name",name);
        jsonObject.put("age",age);
        jsonObject.put("qq",qq);
        jsonObject.put("gender",gender);
        jsonObject.put("tel",tel);
        jsonObject.put("jobId",job_id);
        jsonObject.put("sourceId",source_id);
        jsonObject.put("sellerName",seller);
        jsonObject.put("sellerId",seller_id);
        ;

        return jsonObject;
    }

    @Override
    public String toString() {
        return "Customer{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender=" + gender +
                ", tel='" + tel + '\'' +
                ", qq='" + qq + '\'' +
                ", job_id=" + job_id +
                ", source_id=" + source_id +
                ", seller_id=" + seller_id +
                ", input_user_id=" + input_user_id +
                ", input_time=" + input_time +
                ", status=" + status +
                ", job='" + job + '\'' +
                ", source='" + source + '\'' +
                ", seller='" + seller + '\'' +
                '}';
    }
}